package main

import "fmt"

func twoSum(nums []int, target int) []int {
	result := []int{}
	flag := false

	for i := 0; i < len(nums); i++ {
		if flag == false {
			for j := i + 1; j < len(nums); j++ {
				if nums[i]+nums[j] == target {
					flag = true
					result = append(result, i)
					result = append(result, j)
					break
				}
			}
		} else {
			break
		}
	}
	return result

}

func main() {
	nums := []int{1, 2, 3, 4, 5}
	targetnum := 6
	des := twoSum(nums, targetnum)
	fmt.Println(des)

}
